package pld.car.dao.impl;

import pld.car.dao.*;
import org.springframework.orm.hibernate3.support.*;
import org.hibernate.*;
import java.util.*;

public class BaseDaoImpl extends HibernateDaoSupport implements BaseDao {

	public BaseDaoImpl() {
		System.out.println("BaseDaoImpl init!");
	}

	// 根据输入的SQL，返回对象列表
	public List<Object> runSQL(String sql, int first, int number) {
		Query q = getSession().createQuery(sql);
		q.setFirstResult(first);
		q.setMaxResults(number);
		List<Object> list = q.list();
		return list;
	}

	// 根据输入的SQL，返回对象列表
	public List<Object> runSQL(String sql) {
		Query q = getSession().createQuery(sql);
		List<Object> list = q.list();
		return list;
	}
}
